<?php
/**
 * @package WP_phpmyadmin	
 * @version 1.0
 */
/*
Plugin Name: WP phpmyadmin
Plugin URI:   
Description: This is not just a plugin,it's phpmyadmin in your wordpress blog.
Author: Hung Dang
Version: 1.0
Author URI:  
*/

add_action('admin_menu', 'hdd_wp_phpmyadmin_menu');

function hdd_wp_phpmyadmin_menu() {
	add_options_page('My Plugin Options', 'Php_myadmin', 'manage_options', 'hdd_wp_phpmyadmin', 'hdd_wp_phpmyadmin_options');
}

function hdd_wp_phpmyadmin_options() {
	if (!current_user_can('manage_options'))  {
		wp_die( __('You do not have sufficient permissions to access this page.') );
	}
	$gotoLink = plugins_url().'/phpmyadmin/phpadmin/index.php?db_user='.DB_USER.'&db_pass='.DB_PASSWORD.'&db_host='.DB_HOST.'&db_only='.DB_NAME;
	 
	echo '<div class="wrap">';
	echo '<iframe scrolling="yes" frameborder="0" allowtransparency="true" 
			style="border: medium none; overflow: auto; width: 100%; height:1000px;" 
			src="'.$gotoLink.'">
			</iframe>';
	echo '</div>';
}


?>
